<?php
if ($admin_value['admin_type'] == 'Web Admin' || $admin_value['admin_type'] == 'Sub Admin') {
	$this -> admin = 'admin';
} else {
	$this -> admin = 'panelist';
}
$this -> load -> view('admin/head');
$this -> load -> view('admin/header');
?>

  <!-- Content -->    

  <div class="space30"></div>
  <div class="container">
    <div class="row"> 
    <div class="col-md-2">
    	<nav class="navbar1">
         <?php $this->load->view('admin/left_nav'); ?> 
    </nav>
    </div>
      <div class="col-md-10">
        <!--form starts-->
			
        	<div class="form_container">
            		<h4>Manage Panelist</h4>
                     <!--row starts-->
                    	<div class="row1">
						<?php echo form_open(BASE_URL.'/'.$this->admin.'/manage_panelist', array('id' => 'manage_search_form1', 'method' => 'post'));?>
		
                    	<div class="form-group col-sm-12">
                        	<label for="name2">Search by Name</label>
                            <input class="form-control white" id="panelist_search_name" name="panelist_search_name" placeholder="Enter Name" type="text" value="<?php if(isset($search_tag) && $search_tag != ''){ echo $search_tag;} ?>">
                            <div class="error" id="err-search1"></div>
                        </div>
                       
					   <div class="form-group col-sm-12">
                        	<label for="affiliation2">Search by Affiliation</label>
                            <input class="form-control white" id="affiliation2" name="affiliation2" type="text" placeholder="Enter Affiliation" value="<?php if(isset($search_tag1) && $search_tag1 != ''){ echo $search_tag1;} ?>">
                            <div class="error" id="err-search2"></div>
                        </div>
					   
         				<div class="form-group col-sm-12">
            			<button type="submit" class="btn btn-primary" id="panelist_search_btn">Search</button>
                        </div>
                        <div class="clearfix"></div>
						<?php echo form_close(); ?>
                    
                    <!--row closed-->
                    <!--row starts-->
                        <div class="row1">
                        <div class="table-responsive">
                          <table border="0" cellspacing="0" cellpadding="0" class="manage_table">
                              <tr>
                                <td width="8%">S.No.</td>
                                <td width="15%">Full  Name</td>
                                <td width="22%" >Email</td>
                                <td width="9%">Contact</td>
                                <td width="18%">Affiliation</td>
                                <td width="7%">Edit</td>
                                <td width="6%" >Delete</td>
                                <td width="10%">Status</td>
                              </tr>
							  <?php if(isset($search_value) && !empty($search_value)){
								foreach($search_value as $temp => $value){?>
                              <tr>
                                <td><?php echo $temp+1; ?></td>
                                <td><?php if(isset($value['admin_fullname'])){ echo ucwords($value['admin_fullname']);} ?></td>
                                <td><?php if(isset($value['admin_email'])){ echo $value['admin_email'];} ?></td>
                                <td><?php if(isset($value['admin_contact_number'])){ echo $value['admin_contact_number'];} ?></td>
                                <td><?php if(isset($value['admin_affiliation'])){ echo $value['admin_affiliation'];} ?></td>
                                <td><a href="javascript:void(0)" 
									onclick="edit_panelist('<?php if(isset($value['admin_id'])){ echo $value['admin_id'];} ?>','<?php echo BASE_URL.'/'.$this->admin; ?>')">
									<img src="<?php echo ASSET_URL; ?>img/admin/edit.png" style="width:20px;" alt="edit"></a></td>
                                <td><a href="javascript:void(0)" onclick="delete_panelist('<?php if(isset($value['admin_id'])){ echo $value['admin_id'];} ?>','<?php echo BASE_URL.'/'.$this->admin; ?>')"><img src="<?php echo ASSET_URL; ?>img/admin/delete.png" style="width:20px;" alt="delete"></a></td>
                                <td><a href="javascript:void(0)" 
									onclick="status_panelist('<?php if(isset($value['admin_id'])){ echo $value['admin_id'];} ?>','<?php echo BASE_URL.'/'.$this->admin; ?>','<?php if(isset($value['admin_status'])){ echo $value['admin_status'];} ?>')">
									<img src="<?php echo ASSET_URL; ?>img/admin/<?php if(isset($value['admin_status']) && $value['admin_status']=='Inactive'){echo 'in';}?>active.png" alt="status"></a></td>
                              </tr>
                              <?php }}else{?>
								<tr><td colspan="8">No Record Found</td></tr>
							<?php }?>
                            </table>
							<div class="space20"></div>
						<?php
							if(count($search_count) > '2')
							{
								$this->load->view('admin/manage_admin/pagination');
							} 
						?>	
</div>
</div>
</div>
         <div class="space30"></div>
              </div>
        <!--row closed-->     
        <!--modal starts-->
        	<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
          <div class="modal-dialog">
            <div class="modal-content">
              <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myModalLabel">Modal title</h4>
              </div>
              <div class="modal-body">
                Are you Sure You want to delete this entry?
              </div>
              <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Yes</button>
                <button type="button" class="btn btn-primary">No</button>
              </div>
            </div>
          </div>
		</div>
        <!--modal closed-->              
        </div>
        <!--form closed-->
         <div class="space30"></div>
        
      </div>
       <div class="clearfix"></div>
    </div>    
  </div>    
  <div class="space20"></div>  
  <div class="space30"></div>  
  
  <!-- Content End -->
<?php $this ->load->view('common/footer'); ?>